﻿using System;
using System.Collections.Generic;
using System.Text;
using MySql.Data.MySqlClient;
using System.Data;

namespace ConnectCsharpToMysql.objects
{
    class Database
    {
        public static List<String> getListTableName()
        {
            List<String> listTableName = new List<string>();
            String strSelect = "SELECT DISTINCT TABLE_NAME " +
                            "FROM INFORMATION_SCHEMA.COLUMNS " +
                            "WHERE TABLE_NAME LIKE '%tb%' AND TABLE_NAME != 'tbl_user'";
            DataTable dataTable = new DBConnect().Select(strSelect);
            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                listTableName.Add(dataTable.Rows[i][0].ToString());
            }
            return listTableName;
        }
    }
}
